<?
ini_set('session.save_path', dirname(__FILE__).'/session/'); 
session_start();

$code1 = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<title>'.SITE_HEADER.'</title>';
	if($_COOKIE["vcode"]==null or $_SESSION['VCODE']==null){
				setcookie("name",'');
	setcookie("pw", '');
		exit( $code1.'<meta http-equiv="refresh" content="3;url=./index.php"><div style="width:500px; margin:20px auto; padding:30px; border:#999 1px dotted; text-align:center;">'.SITE_LOGIN_TIME_OUT_LOGIN.'<a href="./index.php">'.SITE_BACK.'</a><script>alert("'.SITE_LOGIN_TIME_OUT_LOGIN.'");  location="./";</script></div>');
		}
$_SESSION['VCODE']<>$_COOKIE["vcode"]?
exit($code1.'<meta http-equiv="refresh" content="3;url=./index.php">
			<div style="width:500px; margin:20px auto; padding:30px; border:#999 1px dotted; text-align:center;">'.SITE_LOGIN_ERROR_AUTH_CODE.'<a href="./index.php">'.SITE_BACK.'</a><script>alert("'.SITE_LOGIN_ERROR_AUTH_CODE.'");  location="./";</script></div>'):'';
$checkmember = $db->select("select id,password,uid from ".tablepre."user where id = '".$_COOKIE[name]."'");
if($checkmember[0][0]==TRUE){
$leveltype = $db->select("SELECT * FROM `".tablepre."vip` where vid = ".mamber($con1=$checkmember[0][2],$con2=4)."");
}
//会员等级
if($checkmember[0][0]<>$_COOKIE["name"] || $checkmember[0][1]<>$_COOKIE["pw"]){
echo $code1;
$db->INSERT("INSERT INTO `".tablepre."save` (`value`,`datetime`,`ip`) VALUES ('用户(".$clientIp.") 尝试用 ".$_COOKIE['name']." 登陆 并失败', '".datetime."','".$clientIp."')");
echo '<meta http-equiv="refresh" content="3;url=./index.php">
			<div style="width:500px; margin:20px auto; padding:30px; border:#999 1px dotted; text-align:center;">'.SITE_LOGIN_FAILED.'<a href="./index.php">'.SITE_BACK.'</a><script>alert("'.SITE_LOGIN_FAILED.'"); location="./";</script></div>';
exit;
}
?>